<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"
   xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
   template="/WEB-INF/templates/default.xhtml">
   
   	<f:metadata>
	   	<f:viewParam name="recordId" value="#{determinedRecordrHome.id}"></f:viewParam>
	  	<f:event listener="#{determinedRecordrHome.initConversation()}" type="preRenderView"></f:event>
	   	<f:viewParam name="moduleName" value="待定名单审核"></f:viewParam>
   	</f:metadata>
   <ui:define name="head">
   		<style type="text/css">
   		.column{
   			width: 20%;
   		}
   		.ui-datalist-content{
   		
   			border:none;
   		}
   		.tip{
   			color:red;
   			
   		}
   		</style>
   </ui:define>
   	<ui:define name="content">
   
		<h:form id="editForm">         
			<p:panel id="panel" header="待定名单审核" style="margin-bottom:10px;">
		        <p:messages id="messages" closable="true"><p:autoUpdate/></p:messages>
		        <p:panelGrid>		        	
		        	<p:row>
		       			<p:column styleClass="column">        			
							<p:outputLabel  value="提交人" />							
			       		</p:column>
			       		<p:column  >
							#{determinedRecordrHome.instance.submitUser.cnname}
			       		</p:column>
			       	</p:row>
			       	
			       	<p:row>
		       			<p:column styleClass="column">        			
							<p:outputLabel  value="提交时间" />							
			       		</p:column>
			       		<p:column  >
							#{determinedRecordrHome.instance.supplier.cnname}
			       		</p:column>
			       	</p:row>
			       		
					<p:row>
		       			<p:column styleClass="column">        			
							<p:outputLabel  value="中介机构名称" />							
			       		</p:column>
			       		<p:column  >
							<h:outputText  value="#{determinedRecordrHome.instance.submitDate}"  >
								<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss "/>
							</h:outputText>
			       		</p:column>
			       	</p:row>
		        	
		       	 	<p:row>
		       			<p:column styleClass="column">        			
							<p:outputLabel  value="列入待定名单期限" />							
			       		</p:column>
			       		<p:column  >
							<h:outputText  value="#{determinedRecordrHome.instance.startDate}"  >
								<f:convertDateTime pattern="yyyy-MM-dd"/>
							</h:outputText>
							至
							<h:outputText  value="#{determinedRecordrHome.instance.endDate}"  >
								<f:convertDateTime pattern="yyyy-MM-dd"/>
							</h:outputText>    		
			       		</p:column>
			       	</p:row>
			       	<p:row>
			       		<p:column styleClass="column">
			       			<p:outputLabel  value="证据材料" />		
			       		</p:column>
			       		<p:column  >
			       			<p:dataList var="_attr" value="#{determinedRecordrHome.instance.undeterminedRoster.evidences}">
									<p:commandButton style="margin-left:10px;" ajax="false"  icon="ui-icon-arrowthick-1-s">
								        <p:fileDownload value="#{fileDownloadView.download(_attr)}" />
								        <h:outputText value="#{_attr.filename}" />
								    </p:commandButton>									
								</p:dataList>	
			       		</p:column>
			       	</p:row>
			       	
				    <p:row>
			       		<p:column styleClass="column" >
			       			<p:outputLabel  value="备注" />		
			       		</p:column>
			       		<p:column >
			       			#{determinedRecordrHome.instance.undeterminedRoster.remark}
			       		</p:column>
			       	</p:row>
			       	
				    <p:row>
			       		<p:column styleClass="column">
			       			<p:outputLabel  value="整改情况材料" />		
			       		</p:column>
			       		<p:column>
			       			<p:dataList var="_attr" value="#{determinedRecordrHome.instance.undeterminedRoster.evidences}">
									<p:commandButton style="margin-left:10px;" ajax="false"  icon="ui-icon-arrowthick-1-s">
								        <p:fileDownload value="#{fileDownloadView.download(_attr)}" />
								        <h:outputText value="#{_attr.filename}" />
								    </p:commandButton>									
							</p:dataList>	
			       		</p:column>
			       	</p:row>
					
					<p:row>
			       		<p:column styleClass="column tip" >
			       			<p:outputLabel  value="当前操作" />		
			       		</p:column>
			       		<p:column >
			       			#{determinedRecordrHome.instance.operationStr()}
			       		</p:column>
			       	</p:row>
					
					<p:row rendered="#{determinedRecordrHome.instance.recordStatus eq 'Keeped'}">
			       		<p:column styleClass="column tip" >
			       			<p:outputLabel  value="保留截至时间（新）" />		
			       		</p:column>
			       		<p:column >
			       			<h:outputText  value="#{determinedRecordrHome.instance.newEndDate}"  >
								<f:convertDateTime pattern="yyyy-MM-dd"/>
							</h:outputText>    	
			       		</p:column>
			       	</p:row>
					
				</p:panelGrid>
			</p:panel>
			
			<p:commandButton action="#{determinedRecordrHome.audit()}" value="审核通过" ajax="false" />
			<p:commandButton oncomplete="PF('rejectDialog').show();" value="驳回" immediate="true"></p:commandButton>			
			<p:commandButton action="#{determinedRecordrHome.cancel()}" value="取消" immediate="true"></p:commandButton>
		</h:form>
		
		<p:dialog id="rejectDialog" widgetVar="rejectDialog">
			<f:facet name="header">
				驳回原因
			</f:facet>
			<h:form>
				<p:panelGrid columns="2">
					<p:outputLabel for="reason" value="驳回原因"></p:outputLabel>
					<p:inputTextarea
						id="reason"
						value="#{rejectRecordHome.instance.reason}"
						required="true"
						cols="80"
						rows="5"
					></p:inputTextarea>
				</p:panelGrid>
								
				<p:commandButton action="#{determinedRecordrHome.reject}" value="驳回" ajax="false" />
				<p:commandButton oncomplete="PF('rejectDialog').hide();" value="取消" immediate="true"></p:commandButton>
			</h:form>
		</p:dialog>
   	</ui:define>
</ui:composition>
